/*
 * =====================================================================================
 *
 *       Filename:  main.c
 *
 *    Description:  this is app to test QCfgLog
 *
 *        Version:  1.0
 *        Created:  2012年04月18日 11时25分09秒
 *       Revision:  none
 *       Compiler:  g++
 *
 *         Author:  Michael lee
 *         E-mail:  Michael.20#qq.com
 *
 * =====================================================================================
 */
#include "QCfgLog.h"
#include <stdio.h>

int main()
{
    char *buffer = NULL;
    QCfgLog cfg("/tmp/log"); //set path when consturct
    cfg.setValue("abcd","2012"); //set cfg item name and value
    if ((buffer =cfg.value("abcd")) == NULL) //get val by item name
    {
        printf("Error!read value function Error!\n");
        return -1;
    }
    printf("value is %s\n", buffer);

    cfg.log("helloworld!"); //add a log "helloworld"

    free(buffer);   //release memory
    return 0;
}

